home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / PASCAL / ALLSWAGS.ZIP / SWAGG-M.ZIP / MISC.SWG / 0164_Source to tickertape.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-11-22  |  3.6 KB  |  111 lines

  1. {
  2. Heres some source to tickertape a string with a few demos I stumbled on :) If
  3. you use this source or like it please tell me what you think and give me
  4. credit :) Thanx...
  5. ---------> CUT <--------
  6. }
  7. Uses CRT;
  8.  
  9.     Procedure WaitRetrace; Assembler;
  10.       Asm
  11.         mov     dx,3dah
  12. @L1:
  13.         in      al,dx
  14.         test    al,08h
  15.         jne     @L1
  16. @L2:
  17.         in      al,dx
  18.         test    al,08h
  19.         je      @L2
  20.       End;
  21.  
  22. Function TickerR(Instring : String) : String;
  23. Var                                    {Ticks right.                        }
  24.  TmpStr  : String;                     {Temporary string.                   }
  25.  TmpChar : String;                     {Temporary character.                }
  26. Begin                                  {Begin code.                         }
  27.  TmpChar:=Instring[Length(Instring)];  {Grab the last character.            }
  28.  Insert(TmpChar,Instring,1);           {Insert it before the 1st character. }
  29.  Delete(Instring,Length(Instring),1);  {Delete the last character.          }
  30.  TickerR:=Instring;                    {And return the result.              }
  31. End;                                   {Exit function.                      }
  32.  
  33. Function TickerL(Instring : String) : String;
  34. Var                                    {Ticks wrong ;) (left)               }
  35.  TmpStr  : String;                     {Temporary string.                   }
  36.  TmpChar : Char;                       {Temporary character.                }
  37. Begin                                  {Begin code.                         }
  38.  TmpChar:=Instring[1];                 {Grab the 1st character.             }
  39.  Delete(Instring,1,1);                 {Delete the 1st character.           }
  40.  TmpStr:=Instring+TmpChar;             {Tape the 1st onto the end.          }
  41.  TickerL:=TmpStr;                      {And return the result.              }
  42. End;                                   {Exit function.                      }
  43.  
  44. Var
  45.  Tick1,Tick2 : String;                 {Holds the 2 demo strings.           }
  46.  Msg         : String;                 {The message.                        }
  47. Begin
  48. ClrScr;
  49. Msg:='     Press a key for 1st demo....While running - Press a key for next.';
  50. Repeat
  51. Msg:=TickerL(Msg);
  52. WaitRetrace;
  53. Write(Msg+#13);
  54. Delay(200);
  55. Until Keypressed;
  56. ReadKey;
  57. Tick1:='Howdy there everyone! How are ya all? Very good I hope....Well......Adios! ';
  58. Tick2:=Tick1;
  59. {Try uncommenting these down here... Pretty weird looking in #2!}
  60. {Tick1:='░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓
  61. ▓▒░▒▓█▓▒';Tick2:='░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒
  62. ░▒▓█▓▒░▒▓█▓ ▒░▒▓█▓▒';}
  63. Repeat
  64. Tick1:=TickerR(Tick1);
  65. Tick2:=TickerL(Tick2);
  66. GotoXY(1,1);
  67. WaitRetrace;
  68. WriteLn(Tick1);
  69. Write(Tick2);
  70. Until Keypressed;
  71. ReadKey;
  72. ClrScr;
  73. Msg:='     Press a key for 2nd demo....While running - Press a key for next.';
  74. Repeat
  75. Msg:=TickerL(Msg);
  76. WaitRetrace;
  77. Write(Msg+#13);
  78. Delay(200);
  79. Until Keypressed;
  80. ReadKey;
  81. Repeat
  82. Tick1:=TickerR(Tick1);
  83. Tick2:=TickerL(Tick2);
  84. WaitRetrace;
  85. WriteLn(Tick1);
  86. WriteLn(Tick2);
  87. Until Keypressed;
  88. ReadKey;
  89. ClrScr;
  90. Msg:='     Press a key for 3rd demo....While running - Press a key to end.';
  91. Repeat
  92. Msg:=TickerL(Msg);
  93. WaitRetrace;
  94. Write(Msg+#13);
  95. Delay(200);
  96. Until Keypressed;
  97. ReadKey;
  98. Tick1:='Here we go to merge again...And again. ';
  99. Tick2:=Tick1;
  100. Repeat
  101. GotoXY(1,1);
  102. Tick1:=TickerR(Tick1);
  103. Tick2:=TickerL(Tick2);
  104. WaitRetrace;
  105. Write(Tick1+'│'+Tick2+#10#13+Tick2+'│'+Tick1);
  106. Until Keypressed;
  107. ReadKey;
  108. WriteLn(#10#10#13'█▓▒░ Bye! Remember to give me credit for this! :) ░▒▓█');
  109. End.
  110.